package cn.dyw.cloudmusic.dao;

import cn.dyw.cloudmusic.entity.LyricUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface LyricUserMapper {
    /**
     */
    @Delete({
        "delete from lyric_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     */
    @Insert({
        "insert into lyric_user (id, status, ",
        "demand, userid, ",
        "nickname, uptime)",
        "values (#{id,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
        "#{demand,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, ",
        "#{nickname,jdbcType=VARCHAR}, #{uptime,jdbcType=TIMESTAMP})"
    })
    int insert(LyricUser record);

    /**
     */
    int insertSelective(LyricUser record);

    /**
     */
    @Select({
        "select",
        "id, status, demand, userid, nickname, uptime",
        "from lyric_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("cn.dyw.cloudmusic.dao.LyricUserMapper.BaseResultMap")
    LyricUser selectByPrimaryKey(Integer id);

    /**
     */
    int updateByPrimaryKeySelective(LyricUser record);

    /**
     */
    @Update({
        "update lyric_user",
        "set status = #{status,jdbcType=INTEGER},",
          "demand = #{demand,jdbcType=INTEGER},",
          "userid = #{userid,jdbcType=INTEGER},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "uptime = #{uptime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(LyricUser record);
}